import request from '@/utils/request'
import url from 'postcss-url'

//查询合同记录所有信息
export function selectContractAll() {
    return request({
        url: '/contract/selectContractAll',
        method: 'get',
    })
}
//创建合同渲染界面分页查询
export function getLimit(data) {
    return request({
        url: '/contract/getLimit',
        method: 'post',
        params: data
    })
}
//批量删除
export function delListContract(data) {
    return request({
        url: '/contract/delListContract',
        method: 'post',
        data: data,
    })
}
//添加合同记录
export function addContract(data) {
    return request({
        url: '/contract/addContract',
        method: 'post',
        params: data
    })
}
//查询已添加客户名
export function getClientUserName() {
    return request({
        url: 'contract/getClientUserName',
        method: 'get'
    })
}
//上传文件
export function fileupload(data) {
    return request({
        url: '/contract/fileupload',
        method: 'post',
        headers: { 'Content-Type': 'multipart/form-data' },
        data: data
    })
}
//下载文件
export function downloadFile(filename) {
    return request({
        url: '/contract/download/',
        method: 'get',
        responseType: 'blob',
        headers: { 'Expect': '' },
        params: { filename }
    })
}
//获取当前用户头像
export function getAvatar() {
    return request({
        url: '/contract/getIco',
        method: 'get',
    })
}
//查看当前用户西悉尼
export function getUsers() {
    return request({
        url: '/contract/getUsers',
        method: 'get',
    })
}
//修改当前用户信息
export function updateUser(data) {
    return request({
        url: '/contract/updateUser',
        method: 'post',
        params: data
    })
}
//修改密码
export function updatePwd(data) {
    return request({
        url: '/contract/updatePwd',
        method: 'post',
        params: data
    })
}
//获取文件名
export function getFile() {
    return request({
        url: '/contract/getFile',
        method: 'get'
    })
}
//注册
export function register(data) {
    return request({
        url: '/user/register',
        method: 'post',
        params: data
    })
}